
import { _decorator, Component, Node, Vec3, Label, instantiate } from 'cc';

const { ccclass, property } = _decorator;

@ccclass('Card')
export class Card extends Component {

    content: string = null;
    _index: number = null;

    init(pos: Vec3, txt: string, index: number) {
       this.node.position = pos;
       this.content = txt;
       this._index = index;
       this.node.getChildByName('Text').getComponent(Label).string = txt;
    }

    getContent() {
        return this.content;
    }

    getIndex() {
        return this._index;
    }
}

